<h3>Introduction</h3>

NOTEX stands for "Network Oriented Transforms in ECMAScript and XML" and is implemented in the CGI script <a href="http://notex.googlecode.com/files/notex.cgi">notex.cgi</a>
<p />
This CGI script enables you to:
<ol>
  <li>Read and run <b>server-side</b> any JavaScript file located anywhere on the web</li>
  <li>Use this JavaScript file to process XML files located anywhere on the web</li>
  <li>Cache your results to give faster responses to subsequent requests</li>
</ol>
The project is hosted by Google at <a href="http://code.google.com/p/notex/">http://code.google.com/p/notex/</a> and there's a <a href="http://www.facebook.com/home.php#/group.php?gid=67648856577">Facebook NOTEX group</a> too - please join us.

<h3>An example</h3>

This is best explained using a simple JavaScript file <b>example.js</b>:
<pre>
var file_contents = GET('mydata.com/data.xml'); // read a file of XML data
var xml = new XML(file_contents); // turn the string into an E4X data structure
xml.head.title = 'My new title';  // change a part of the XML data structure
write(xml.toXMLString());         // write out the changed version as XML
</pre>

If this file is located at the URL <b>myscripts.com/example.js</b> then it may be run by hosting <a href="http://notex.googlecode.com/files/notex.cgi">notex.cgi</a> at your domain "mydomain.com" and running a query like this:
<p />
<b>mydomain.com/notex.cgi?app=demo&amp;token=abcd&amp;script=myscripts.com/example.js</b>
<p />
Notice that the <b>notex.cgi</b> CGI script, the <b>example.js</b> JavaScript file and <b>data.xml</b> XML file are all located at different domains. The <b>notex.cgi</b> CGI script acts as a network hub running a JavaScript program to read and process XML files from around the web, then output new XML results.  In effect, the NOTEX system transforms XML into new XML via JavaScript programs.

<h3>Caching</h3>

As you would expect, it can take a few seconds to read the JavaScript file, run the JavaScript file, read the XML file(s) and output the results, so here's a faster version of the same query:
<p />
<b>mydomain.com/notex.cgi?app=demo&amp;token=abcd&amp;script=myscripts.com/example.js&amp;cache=3600</b>
<p />
The <b>cache=3600</b> part of the query tells the CGI script to cache the output for 1 hour (3600 seconds). This works well when the data processed by the script does not regularly change, but if you only want to cache the JavaScript file you can use a query like this:
<p />
<b>mydomain.com/notex.cgi?app=demo&amp;token=abcd&amp;script=myscripts.com/example.js&amp;jcache=3600</b>
<p />
Here the <b>jcache=3600</b> part of the query tells the CGI script to cache the JavaScript file <b>myscripts.com/example.js</b> for 1 hour. Only use this option when you're running your tested JavaScript files in production environments.

<h3>Conclusions</h3>

In this short introduction, we've covered:
<ul>
  <li>What NOTEX is and how it is implemented in the <b>notex.cgi</b> CGI script</li>
  <li>How the various network resources can be located anywhere on the web</li>
  <li>The way that <b>notex.cgi</b> reads and runs JavaScript files on the server</li>
  <li>Ways to cache the <b>notex.cgi</b> script to make it perform faster</li>
</ul>
I invite you to try <a href="http://notex.googlecode.com/files/notex.cgi">notex.cgi</a> (or the FastCGI version <a href="http://notex.googlecode.com/files/notex.fcgi">notex.fcgi</a>) for yourself by clicking the "Download" tab at the top of this page, and following the (hopefully) detailed instructions.
<p />
Enjoy!
